package com.ftg.learn.config;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 来管理
 *
 * @author 布衣
 */
@RestControllerAdvice
public class GlobalException {


//    springcloud sentinel 数据源切换到nacos
//    sprnigcloud gateway sentinel例子配置完成

    /**
     * 是否更合理呢
     * @param e BlockException
     * @return
     */
    @ExceptionHandler(value= BlockException.class)
    public String testSentinelFallback(Exception e) {
        return "sentinel fallback------";
    }

}
